<template>
  <el-dialog
      :title="editing ? '编辑测量类型' : '新增测量类型'"
      :visible.sync="show"
      width="30%"
      center
    >
      <!-- 对话框的内容 -->
      <el-form ref="form" :model="form" label-width="80px">
        <el-form-item v-if="form.id" label="测量编号">
          <el-input
            disabled
            v-model="form.id"
            placeholder="请输入测量名称"
          ></el-input>
        </el-form-item>
        <el-form-item label="测量名称">
          <el-input clearable v-model="form.name" placeholder="请输入测量名称"></el-input>
        </el-form-item>
        <el-form-item label="测量单位">
          <el-input clearable v-model="form.unit" placeholder="请输入测量单位"></el-input>
        </el-form-item>

        <el-form-item>
          <el-button type="primary" @click="$emit('submit')" :loading="loading"
            >立即提交</el-button
          >
          <el-button @click="show=false">取消</el-button>
        </el-form-item>
      </el-form>
    </el-dialog>
</template>

<script>
export default {
    props:['form','editing','loading'],
    data() {
      return {
        show: false
      }
    }
}
</script> 